<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // 选择结构的嵌套:  在满足特定条件的情况下,进行二次判断

    // 多分支
    // var grade = Math.round(Math.random()*100); // 0-100
    var grade = 55; // 0-100
    console.log(grade); 

    if(grade >= 90) {  // grade >= 90 && grade < 100
        // document.write(grade + "分,优秀");
        if(grade == 100){
            document.write(grade + "分, 999");
        }else{
            document.write(grade + "分,优秀");
            console.log(3);
        }

    }else if(grade >= 80 ){  //  grade >= 80 && grade < 90
        document.write(grade + "分,良好");
    }else if(grade >= 70 ){  //  grade >= 70 && grade < 80
        document.write(grade + "分,一般");
    }else if(grade >= 60 ){  //  grade >= 60 && grade < 70
        document.write(grade + "分,勉强及格");
    }else{ // grade < 60
        // document.write(grade + "分,不及格");
        if(grade >= 50){
            document.write(grade + "分,不及格,开机试");
        }else{
            document.write(grade + "分,再来一次");
        }
        
    }



</script>
</html>